package com.bjesc_b2c.app.appraiset.mvp.presenter.impl;

import android.content.Context;

import com.bjesc_b2c.app.appraiset.mvp.model.CusDetailsModel;
import com.bjesc_b2c.app.appraiset.mvp.model.impl.CusDetailsModelImpl;
import com.bjesc_b2c.app.appraiset.mvp.presenter.CusDetailsPresenter;
import com.bjesc_b2c.app.appraiset.mvp.view.CusDetailsView;

import master_bean.CustomerDetailsBean;

/**
 * Created by yidong on 2017/5/24.
 */

public class CusDetailsPresenterImpl implements CusDetailsPresenter, CusDetailsModelImpl.CallBack {
    private CusDetailsView cusView;
    private CusDetailsModel cusDetailsModel;

    public CusDetailsPresenterImpl(CusDetailsView cusView) {
        this.cusView = cusView;
        cusDetailsModel = new CusDetailsModelImpl(this);
    }

    @Override
    public void loadCompleted() {
        cusView.loadCompleted();
    }

    @Override
    public void loadFailure() {
        cusView.loadFailure();
    }

    @Override
    public void loadStart() {
        cusView.loadStart();
    }

    @Override
    public void getDetails(String id,int type) {
        cusDetailsModel.getDetails((Context) cusView, id,type);
    }

    @Override
    public void callback(CustomerDetailsBean bean) {
        cusView.getDatas(bean);
    }
}
